using Microsoft.IdentityModel.Protocols.WSTrust;
using System.Security;
using System.Security.Permissions;
namespace Net35.Xrm.Sdk.Client
{
	[SecuritySafeCritical]
	[SecurityPermission(SecurityAction.Demand, Unrestricted = true)]
	internal sealed class ServiceFederatedChannel<TChannel> : ServiceChannel<TChannel> where TChannel : class
	{
		private readonly System.IdentityModel.Tokens.SecurityToken _token;
		public ServiceFederatedChannel(System.ServiceModel.ChannelFactory<TChannel> factory, System.IdentityModel.Tokens.SecurityToken token) : base(factory)
		{
			ClientExceptionHelper.ThrowIfNull(token, "token");
			this._token = token;
		}
		[SecuritySafeCritical]
		protected override TChannel CreateChannel()
		{
			return base.Factory.CreateChannelWithIssuedToken(this._token);
		}
	}
}
